﻿@model PagedList.IPagedList<BanDTBLL.tai_khoan>

@{
    ViewBag.Title = "Index";
}

<h1 align="center" style="color:Blue">THÔNG TIN TÀI KHOẢN</h1>

@using (Html.BeginForm())
{
    <p>
        <b>Tìm kiếm:</b> @Html.TextBox("SearchString")  
        <input type="submit" value="Search" /></p>
}

@*<p>
    @Html.ActionLink("Tạo tài khoản", "Create")
</p>*@
<table>
    <tr>
        <th>
            ma
        </th>
        <th>
            loai_tai_khoan
        </th>
        <th>
            ho_ten
        </th>
        @*<th>
            cmnd
        </th>*@
        <th>
            @Html.ActionLink("Tên đăng nhập", "Index", new { page = Model.PageNumber, sortOrder = ViewBag.NameSortParm, currentFilter = ViewBag.CurrentFilter })
        </th>
        <th>
            mat_khau
        </th>
     @*   <th>
            dia_chi
        </th>*@
        @*<th>
            email
        </th>*@
        @*<th>
            dien_thoai
        </th>*@
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.ma)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.loai_tai_khoan.ten)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ho_ten)
        </td>
        @*<td>
            @Html.DisplayFor(modelItem => item.cmnd)
        </td>*@
        <td>
            @Html.DisplayFor(modelItem => item.ten_dang_nhap)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.mat_khau)
        </td>
@*        <td>
            @Html.DisplayFor(modelItem => item.dia_chi)
        </td>*@
        @*<td>
            @Html.DisplayFor(modelItem => item.email)
        </td>*@
        @*<td>
            @Html.DisplayFor(modelItem => item.dien_thoai)
        </td>*@
        <td>
            @Html.ActionLink("Edit", "Edit", new { id = item.ma }) |
            @Html.ActionLink("Details", "Details", new { id = item.ma }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.ma })
        </td>
    </tr>
}

</table>
<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount
     
    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "Index", new { page = 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "Index", new { page = Model.PageNumber - 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev
    }
     
    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "Index", new { page = Model.PageNumber + 1, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "Index", new { page = Model.PageCount, sortOrder = ViewBag.CurrentSort, currentFilter=ViewBag.CurrentFilter  })
    }
    else
    {
        @:Next >
        @Html.Raw(" ")
        @:>>
    }
</div>